new Vue({
    el:'#app',
    data: {
        fullscreenLoading: false,
        screenLoading: false,
        msgCode: '0'
    },
    mounted:function () {
        var _this = this;
        _this.loadMsgPlatform();
    },
    methods: {
        loadMsgPlatform:function () {
            var _this = this;
            axios.get(request_prefix + "/cash/message/info")
                .then(function (res) {
                    if(res.data.code === 0) {
                        _this.msgCode = res.data.data.msgCode+"";
                    } else {
                        _this.$message.error(res.data.message);
                    }
                })
                .catch(function (res) {
                    _this.$message.error("请求过程发生错误");
                })
        },
        setMsgPlatform:function () {
            var _this = this;
            var data = new URLSearchParams();
            data.append("msgCode",parseInt(_this.msgCode));
            axios.post(request_prefix + "/cash/message/set",data)
                .then(function (res) {
                    if(res.data.code === 0) {
                        _this.$message.success("更改短信平台成功");
                    } else {
                        _this.$message.error(res.data.message);
                    }
                })
                .catch(function (res) {
                    _this.$message.error("请求过程发生错误");
                })
        }
    }
});